Skip to content

feat(i18n): honor localize: [...] per-locale subset - #180

Merged
lukekania merged 1 commit into
milestone/v0.11.0-builder-parityfrom
feat/i18n-localize-subset
May 18, 2026
Merged

feat(i18n): honor localize: [...] per-locale subset#180
lukekania merged 1 commit into
milestone/v0.11.0-builder-parityfrom
feat/i18n-localize-subset

Conversation

@lukekania

Copy link
Copy Markdown
Owner

Part of the v0.11.0 builder-parity milestone. Issue links land on the milestone PR.

Summary

  • --localize on build/watch switches from a bool flag to an optional comma-separated list. --localize (no value) keeps current behaviour (all locales); --localize=en-US,de restricts the output to those two locale subdirectories.
  • fan_out_locales filters i18n.locales against the requested subset, including/excluding the source-locale directory based on whether the source-locale code is in the subset.
  • Architect builder (@ngc-rs/builder:application) now serializes localize: ['en', 'de'] as --localize=en,de and drops the prior "subset not yet honoured" warning. An empty array is treated as true to match @angular/build.
  • Unknown subset entries fail the build with a clear ConfigError instead of silently producing an empty dist/.

Test plan

  • cargo build --release -p ngc-rs
  • cargo test -p ngc-rs (72 passed)
  • cargo clippy --workspace -- -D warnings (clean)
  • npm test in packages/builder (66 passed)
  • E2E against test-ng-project with a temporary i18n.locales: { de }:
    • --localize=de → de subdir only
    • --localize (no value) → both locale subdirs
    • --localize=en-US,de → both subdirs
    • --localize=fr → fails with "subset entry fr is not declared"

Notes

  • Workspace version bumped to 0.10.11.

Switch `--localize` from a bool flag to an optional comma-separated
list so CI builds can emit just the locales they need.

  ngc-rs build --localize           # all i18n.locales (unchanged)
  ngc-rs build --localize=en-US,de  # only those two subdirs

The architect builder now serializes `localize: ['en', 'de']` as
`--localize=en,de` instead of dropping the array and warning. An empty
array still falls back to "all locales" to match `@angular/build`.

`fan_out_locales` validates each subset entry against the source locale
and `i18n.locales` keys; an unknown locale fails the build with a
clear error rather than silently producing an empty `dist/`.
@lukekania
lukekania force-pushed the feat/i18n-localize-subset branch from 7751a2b to b3654b6 Compare May 18, 2026 09:47
@lukekania
lukekania merged commit 23811fc into milestone/v0.11.0-builder-parity May 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant